﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Business
{
    public class ChiTietHDBan
    {
        
        public int MaCTHDB { get; set; }
        public string MaCTHDBHienThi 
        {
            get
            {
                return "CTHDB" + MaCTHDB;
            }
        }
        public int MaHDB { get; set; }        
        public int MaHang { get; set; }
        public string MaHangHienThi 
        {
            get 
            {
                return "HH" + MaHang;
            }
        }
        public string TenHang { get; set; }
        public int SoLuong { get; set; }
        public double DonGiaBan { get; set; }
        public double ChietKhau { get; set; }
        public double ChietKhauHienThi
        {
            get
            {
                return ChietKhau * 100;
            }
        }
        

        
        public ChiTietHDBan(int maHDB, int maHang,
            string tenHang, int soLuong, double donGiaBan, double chietKhau)
        {
            this.MaCTHDB = 0;
            this.MaHDB = maHDB;
            this.MaHang = maHang;
            this.TenHang = tenHang;
            this.SoLuong = soLuong;
            this.DonGiaBan = donGiaBan;
            this.ChietKhau = chietKhau;
        }

        public ChiTietHDBan(int maCTHDB, int maHDB, int maHang,
            string tenHang, int soLuong, double donGiaBan, double chietKhau)
        {
            this.MaCTHDB = maCTHDB;
            this.MaHDB = maHDB;
            this.MaHang = maHang;
            this.TenHang = tenHang;
            this.SoLuong = soLuong;
            this.DonGiaBan = donGiaBan;
            this.ChietKhau = chietKhau;
        }

        public void CapNhat(int maHang,
            string tenHang, int soLuong, double donGiaBan, double chietKhau)
        {
            this.MaHang = maHang;
            this.TenHang = tenHang;
            this.SoLuong = soLuong;
            this.DonGiaBan = donGiaBan;
            this.ChietKhau = chietKhau;
        }
        
    }
}
